import java.awt.Color;
import java.sql.SQLException;

/*
 *  Features.java : This class is an abstract class which provides 
 * 				Employee and Executive class with sound value, 
 * 				color values, and Gmail account values. 
 *  @Author : BilCIS
 */

public abstract class Features 
{
	// Properties
	private boolean sound;
	
	private Color color;
	
	private String notes;
	private String	gmail_username;
	private String	gmail_password;
	
	private Mysql mysql;
	// Properties ending
	
	// Constructor
	public Features( int ID, boolean sound, Color color, String notes, String gmail_username, String gmail_password)
	{
		this.sound = sound;
		this.color = color;
		this.notes = notes;
		this.gmail_username = gmail_username;
		this.gmail_password = gmail_password;
		
		mysql = new Mysql(ID);
	}
	
	// Get methods (Accessors)
	public boolean getSound()
	{
		return sound;
	}
	public Color getColor()
	{
		return color;
	}
	public String getNotes()
	{
		return notes;
	}
	public String getGmail_username()
	{
		return gmail_username;
	}
	public String getGmail_password()
	{
		return gmail_password;
	}
	
	// Set methods (Mutators)
	public void setSound(boolean sound) throws SQLException
	{
		if ( sound == true )
			mysql.setSound(1);
		else
			mysql.setSound(0);
	}
	public void setColor(Color color) throws SQLException
	{
		mysql.setColor_r(color.getRed());
		mysql.setColor_g(color.getGreen());
		mysql.setColor_b(color.getBlue());
	}
	public void setNotes(String notes) throws SQLException
	{
		mysql.setNotes(notes);
	}
	public void setGmailUsername(String gmail_username) throws SQLException
	{
		mysql.setGmailUsername(gmail_username);
	}
	public void setGmailPassword(String gmail_password) throws SQLException
	{
		mysql.setGmailPassword(gmail_password);
	}
}
